-- @Author: 作者QQ381990860
-- @Date:   2022-03-28 19:26:36
-- @Last Modified by:   作者QQ381990860
-- @Last Modified time: 2022-08-02 10:28:32
local 场景类_龙魂系统 = class(窗口逻辑)
function 场景类_龙魂系统:初始化(根)
    self.ID = 352
    self.x = 156
    self.y = 132
    self.xx = 0
    self.yy = 0
    self.注释 = "龙魂系统"
    self.可视 = false
    self.鼠标 = false
    self.焦点 = false
    self.可移动 = true
    self.窗口 = "龙魂系统"
    local 资源 = 根.资源
    local 按钮 = 根._按钮
    local 自适应 = 根._自适应
    self.资源组 = {
        [1] = 自适应.创建(0,1,352,390,3,9),
        [2]= 资源:载入('whe.dll',"网易WDF动画",0x00000017),
        [3] = 按钮.创建(自适应.创建(18,4,16,16,4,3),0,0,4,true,true),
        [4] = 根._按钮(根._自适应(11,4,72,20,1),0,0,4,true,true,"提升等级"),
        [5] = 根._按钮(根._自适应(11,4,72,20,1),0,0,4,true,true,"突破等级"),
        [6] = 根._按钮(根._自适应(11,4,72,20,1),0,0,4,true,true,"洗练属性"),
        [7] = 按钮.创建(资源:载入('whe.dll',"网易WDF动画",0x00000024),0,0,4,true,true),
                  }
        for i=3,7 do
           self.资源组[i]:绑定窗口_(352)
        end

    local 格子 = 根._物品格子
    self.龙魂 = {}
    for i=35,42 do
        self.龙魂[i] = 格子(0,0,i,"龙魂")
    end
    tp = 根
     self.窗口时间 = 0
end

function 场景类_龙魂系统:刷新(数据)
   self.数据=数据
   self.更新=self.数据.类型
            for i=35,42 do
            self.龙魂[i]:置物品(nil)
            end
            for i=35,42 do
            if self.数据[i] ~= nil and self.数据[i] ~= 0 then
            self.龙魂[i]:置物品(self.数据[i])
            end
            end
end

function 场景类_龙魂系统:打开(数据)
    if self.可视 then
        self.可视 = false
        self.窗口 = nil
        self.鼠标 = false

        for i=35,42 do
            self.龙魂[i]:置物品(nil)
            self.龙魂[i].确定=false
        end
        tp.抓取物品 = nil
        tp.抓取物品ID = nil
        self.更新 = nil
    else
       self.数据=数据
       self.更新  =self.数据.类型
        for i=35,42 do
            if self.数据[i] ~= nil and self.数据[i] ~= 0 then
               self.龙魂[i]:置物品(self.数据[i])
            end
        end
        table.insert(tp.窗口_,self)
        tp.运行时间 = tp.运行时间 + 1
        self.窗口时间 = tp.运行时间
        self.可视 = true
    end
end


function 场景类_龙魂系统:显示(dt,x,y)
    self.焦点 = false
    self.资源组[1]:显示(self.x,self.y)
    self.资源组[2]:显示(self.x+150,self.y+30)
    self.资源组[2]:显示(self.x+60,self.y+75)
    self.资源组[2]:显示(self.x+240,self.y+75)
    self.资源组[2]:显示(self.x+30,self.y+150)
    self.资源组[2]:显示(self.x+270,self.y+150)
    self.资源组[2]:显示(self.x+150,self.y+270)
    self.资源组[2]:显示(self.x+60,self.y+225)
    self.资源组[2]:显示(self.x+240,self.y+225)

    self.资源组[3]:显示(self.x+326,self.y+3)
    self.资源组[4]:显示(self.x+20,self.y+350)
    self.资源组[5]:显示(self.x+140,self.y+350)
    self.资源组[6]:显示(self.x+260,self.y+350)
    self.资源组[7]:显示(self.x+150,self.y+150)
    tp.窗口标题背景_:显示(self.x+10+self.资源组[1].宽度/2-90,self.y)
    tp.字体表.华康字体:置颜色(0xFFFFFFFF):显示(self.x+143,self.y+3,"龙脉系统")
     for i=35,42 do
            if i == 35 then
            self.龙魂[i]:置坐标(self.x+150+2,self.y+30)
            elseif i == 36 then
            self.龙魂[i]:置坐标(self.x+240+2,self.y+75)
            elseif i == 37 then
            self.龙魂[i]:置坐标(self.x+270+2,self.y+150)
            elseif i == 38 then
            self.龙魂[i]:置坐标(self.x+240+2,self.y+225)
            elseif i == 39 then
            self.龙魂[i]:置坐标(self.x+150+2,self.y+270)
            elseif i == 40 then
            self.龙魂[i]:置坐标(self.x+60+2,self.y+225)
            elseif i == 41 then
            self.龙魂[i]:置坐标(self.x+30+2,self.y+150)
            elseif i == 42 then
            self.龙魂[i]:置坐标(self.x+60+2,self.y+75)
            end
            self.龙魂[i]:显示(dt,x,y,self.鼠标,nil,0.7)
            if self.龙魂[i].物品 ~= nil and self.龙魂[i].焦点 then
                tp.提示:道具行囊(x,y,self.龙魂[i].物品,true)
            end
            --if self.龙魂[i].事件 and self.更新 =="龙魂" then
            if self.龙魂[i].事件 then
                    if self.龙魂[i].焦点 and tp.抓取物品 == nil and self.龙魂[i].物品 ~= nil then
                        tp.抓取物品ID = i
                           for q=35,42 do
                            self.龙魂[q].确定=false
                           end
                        self.龙魂[tp.抓取物品ID].确定 = true
                    end
            elseif self.龙魂[i].右键 then
                客户端:发送数据(i,78,13,"包裹")
            end
        end

    self.资源组[3]:更新(x,y)
    self.资源组[4]:更新(x,y)
    self.资源组[5]:更新(x,y)
    self.资源组[6]:更新(x,y)
    self.资源组[7]:更新(x,y,self.数据[43]~=0)
    if self.资源组[3]:事件判断()  then
       self:打开()
    elseif self.资源组[4]:事件判断()  then
      if tp.抓取物品ID == nil then
        tp.提示:写入("#Y/请先选择一个")
      else
        客户端:发送数据(tp.抓取物品ID,79,13)
      end
    elseif self.资源组[5]:事件判断()  then
      if tp.抓取物品ID == nil then
        tp.提示:写入("#Y/请先选择一个")
      else
        客户端:发送数据(tp.抓取物品ID,80,13)
      end
    elseif self.资源组[6]:事件判断()  then
      if tp.抓取物品ID == nil then
        tp.提示:写入("#Y/请先选择一个")
      else
        客户端:发送数据(tp.抓取物品ID,81,13)
      end
    elseif self.资源组[7]:是否选中(x,y) then
        if self.数据[43]==0 then
           tzzs="#y/需要佩戴8个门派相同/颜色相同方可激活龙魂套"
        elseif self.数据[43]== "大唐官府" then
           tzzs="#y/大唐官府:#g/横扫千军提升20%/30%/40%/50%的伤害"
        elseif self.数据[43]== "化生寺" then
           tzzs="#y/化生寺:#g/推气过宫提升20%/30%/40%/50%的治疗效果"
        elseif self.数据[43]== "女儿村" then
           tzzs="#y/女儿村:#g/雨落寒沙伤害提升20%/30%/40%/50%"
        elseif self.数据[43]== "方寸山" then
           tzzs="#y/方寸山:#g/落雷符有1%/2%/3%/4%的几率直接秒杀敌人"
        elseif self.数据[43]== "天宫" then
           tzzs="#y/天宫:#g/雷霆万钧提升20%/30%/40%/50%的伤害"
        elseif self.数据[43]== "龙宫" then
           tzzs="#y/龙宫:#g/龙卷雨击伤害提升20%/30%/40%/50%"
        elseif self.数据[43]== "五庄观" then
           tzzs="#y/五庄观:#g/飘渺式提升70%/80%/90%/100%的伤害"
        elseif self.数据[43]== "普陀山" then
           tzzs="#y/普陀山:#g/普渡众生治疗效果提升20%/30%/40%/50%"
        elseif self.数据[43]== "魔王寨" then
           tzzs="#y/魔王寨:#g/飞砂走石提升20%/30%/40%/50%的伤害"
        elseif self.数据[43]== "狮驼岭" then
           tzzs="#y/狮驼岭:#g/鹰击提升70%/80%/90%/100%的伤害"
        elseif self.数据[43]== "盘丝洞" then
           tzzs="#y/盘丝洞:#g/天罗地网提升20%/30%/40%/50%的伤害"
        elseif self.数据[43]== "阴曹地府" then
           tzzs="#y/阴曹地府:#g/阎罗令提高20%/30%/40%/50%伤害"
        elseif self.数据[43]== "凌波城" then
           tzzs="#y/凌波城:#g/浪涌伤害提升70%/80%/90%/100%"
        elseif self.数据[43]== "无底洞" then
           tzzs="#y/无底洞:#g/地涌金莲恢复人数提升1/2/3/4 人数"
        elseif self.数据[43]== "神木林" then
           tzzs="#y/神木林:#g/落叶萧萧伤害提升20%/30%/40%/50%"
        elseif self.数据[43]== "花果山" then
           tzzs="#y/花果山:#g/神针撼海提高70%/80%/90%/100%伤害"
        elseif self.数据[43]== "天机城" then
           tzzs="#y/天机城:#g/匠心畜锐提升20%/30%/40%/50%的效果"
        elseif self.数据[43]== "女魃墓" then
           tzzs="#y/女魃墓:#g/所召唤的人物和参战召唤兽进入战斗提升5%/10%/20%/30%临时气血"
        end
        tp.提示:自定义(x,y+40,tzzs)
    end
end

return 场景类_龙魂系统